import java.io.*;
class FileOutputTest {
    public static void main(String args[]) {
        try {
            FileOutputStream fos = new FileOutputStream("myFile.txt");
            fos.write('H');
            fos.write(69);
            fos.write(76);
            byte[] array = {'a','z','m','o','h','a','n'};
            fos.write(array);
            fos.close();
        } catch (FileNotFoundException e) {
            System.out.println("FileNotFoundException e:" + e.toString());
        } catch (IOException e) {
            System.out.println("IOException e:" + e.toString());
        }
    } 
}
